package be.msec.client.utils;

public class ArrayUtils {

	public static byte[] concat(byte[] a, byte[] b){
		byte[] c= new byte[a.length+b.length];
		System.arraycopy(a, 0, c, 0, a.length);
		System.arraycopy(b, 0, c, a.length, b.length);
		return c;
	}
	
	public static byte[] getSubArray(byte[] array, int offset, int length){
		if(offset>=0&&length>=0&&array!=null&&offset+length<=array.length){
			byte[] ar = new byte[length];
			for(int i=0;i<length;i++)
				ar[i]=array[offset+i];
			return ar;
		}else return null;
	}
}
